<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- import common templates -->
<xsl:import href="../xml/templates/common.xsl"/>
<!-- import main_app templates -->
<xsl:import href="../xml/templates/nav_app.xsl"/>
<!-- xsl output -->
<xsl:output method='html' encoding='UTF-8' doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent='yes'/>

	<!-- template to generate main content -->
	<xsl:template name="UnFeedscribeContent">
		<!-- load extra tabindex params 
		<xsl:call-template name="ExtraDataLoader">
			<xsl:with-param name="src" select="extradata/tabindex"/>
		</xsl:call-template> -->
		<!-- main tab page -->
		<div id="tab_wrapper">
			<form action="../cgi-bin/unfeedscribe.pl" method="post" id="subs_form">
			<h1>Cancel RSS Subscription</h1>
			<fieldset><legend>Delete a subscription</legend>
				<a href="../help/walkthrough.html#arg_delete" onclick="return false;" rel="Delete one or more subscriptions by select the corresponding checkbox in the same row. Then click 'Remove Selected' to apply modifications."><img class="help_ico" id="checker_help" src="../images/icons/help.png" alt="help"  /></a>
					
				<p>Which subscription do you want to delete?</p>
				<table id="feed_table" summary="This is the list of your Feeds. To delete a feed check the checkbox next to te name of the feed. You can check multiple feeds. To apply modifications, click 'Remove Selected' button below the table" cellspacing="0">   
					<colgroup>
						<col class="tb_check" /> 
						<col class="tb_name" />
						<col class="tb_date" />
					</colgroup>      
					<thead>
						<tr>
							<th axis="checkboxes" scope="col">Op</th>
							<th axis="feed name" scope="col">Feed Name</th>
							<th axis="subscription date" scope="col" >Subscription Date</th>
						</tr>
					</thead>
					<tbody>
						<xsl:for-each select="$src_data/userfeed/group">
							<tr class="group_title">
								<td colspan="3"><xsl:value-of select="@groupname"/></td>
							</tr>
							<!-- if got child -->
							<xsl:if test="feed">
								<xsl:for-each select="feed">
									<tr class="odd">
										<td><input type="checkbox" name ="feed_name">
											<xsl:attribute name="value"><xsl:value-of select="name"/></xsl:attribute>
										</input></td>
										<td><xsl:value-of select="name"/></td>
										<!-- date -->
										<td><xsl:value-of select="time_submit"/></td>
									</tr>
								</xsl:for-each>
							</xsl:if>
							<!-- empty group -->
							<xsl:if test="not(feed)">
								<tr class="empty_group"><td>&lt;empty></td></tr>
							</xsl:if>
						</xsl:for-each>
					</tbody>
				</table>
				<ul id="remove_tools">
					<li><input type="submit" value="Remove Selected" /></li>
					<li><input type="reset" value="Reset" /></li>
				</ul>
				<!-- id value -->
				<input type="hidden" name="id">
					<xsl:attribute name="value"><xsl:value-of select="input/id"/></xsl:attribute>
				</input>
			</fieldset>
			</form>
		</div>
		<div id="msgCont">
		</div>
	</xsl:template>
	
	<!-- CREATE PAGE -->
	
	<!-- create page structure -->
	<xsl:template match="root">
		<html>
			<!-- head -->
			<head>
				<!-- load common code -->
				<xsl:call-template name="Loader">
					<xsl:with-param name="src" select="$src_head"/>
				</xsl:call-template>
				<!-- load extra head params -->
				<xsl:call-template name="ExtraDataLoader">
					<xsl:with-param name="src" select="extradata/head"/>
				</xsl:call-template>
				<!-- load ie fix -->
				<xsl:call-template name="IELoader">
					<xsl:with-param name="src" select="$src_head_ie/root/common"/>
				</xsl:call-template>
				<xsl:call-template name="IELoader">
					<xsl:with-param name="src" select="extradata/IEFix"/>
				</xsl:call-template>
				<!-- pagetitle -->
				<title><xsl:value-of select="pagetitle"/></title>
			</head>
			<body>
				<!-- body onload attribute -->
				<xsl:if test="extradata/body/onload/text() != ''">
					<xsl:attribute name="onLoad"><xsl:value-of select="extradata/body/onload"/></xsl:attribute>
				</xsl:if>
				<!-- header -->			
				<xsl:call-template name="Loader">
					<xsl:with-param name="src" select="$src_header"/>
				</xsl:call-template>
				<!-- profile -->
				<xsl:call-template name="ProfileLoader">
					<xsl:with-param name="sid" select="input/id"/>
					<xsl:with-param name="page" select="page"/>
				</xsl:call-template>				
				<!-- navbar -->
				<div id="main_app_navigation">
					<xsl:call-template name="NavAppLoader">
						<xsl:with-param name="src" select="$src_navbar"/>
					</xsl:call-template>
				</div>
				<!-- content -->
				<xsl:call-template name="UnFeedscribeContent">
					<!--<xsl:with-param name="src" select="$src_footer"/>-->
				</xsl:call-template>				
				<!-- footer -->
				<xsl:call-template name="Loader">
					<xsl:with-param name="src" select="$src_footer"/>
				</xsl:call-template>				
			</body>
		</html>
	</xsl:template>
	
</xsl:stylesheet>	
